@extends('layouts.default')
@section('content')
   <div class="card">
      <div class="card-header">
         用户列表
      </div>
      <div class="card-body">
         <table class="table">
            <thead>
            <tr>
               <th>ID</th>
               <th>昵称</th>
               <th>邮箱</th>
               <th>操作</th>
            </tr>
            </thead>
            <tbody>
               @foreach($users as $user)
                  <tr>
                     <td scope="row">{{$user->id}}</td>
                     <td>{{$user->name}}</td>
                     <td>{{$user->email}}</td>
                     <td>
                        <div class="btn-group" role="group" aria-label="Basic example">
                           <button type="button" class="btn btn-danger">删除</button>
                           <button type="button" class="btn btn-warning" onclick="window.location.href='{{route('user.edit',$user)}}'">修改</button>
                           <button type="button" class="btn btn-success" onclick="window.location.href='{{route('user.show',$user)}}'">查看</button>
                        </div>
                     </td>
                  </tr>
               @endforeach
            </tbody>
         </table>
      </div>
      <div class="card-footer text-muted">
         {{$users->links()}}
      </div>
   </div>
@endsection